<?php
namespace Home\Controller;
use Think\Controller;
class BaseController extends Controller {
    public function _initialize(){
         $qrcode=M("image")->where("id > 8")->getField("id,image,address");//获取二维码
         $this->assign('qrcode',$qrcode);
         $base=M('config')->where(array('id'=>1))->find();//获取配置参数
         C($base);
         $link=M('blogroll')->where(array('state'=>1))->select();
          $this->assign('link',$link);
        if(!isset($_SESSION['user_id'])){
        	redirect(__ROOT__.'/index.php/login/index.html');
        }else{
        	$id=$_SESSION['user_id'];
            $result=M('user')->where(array('id'=>$id))->find();

          
            $this->assign('result',$result);
            
        	$realname=$_SESSION['user']['realname'];
        	$this->assign('realname',$realname);
        }

        
    }

}